﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.Serialization;

namespace PVMonMVC.Objects
{
    [DataContract]
    public class PVState
    {
        [DataMember]
        public DateTime TimeStamp { get; set; }
        [DataMember]
        public string Status { get; set; }
        [DataMember]
        public double ACPower { get; set; }
        [DataMember]
        public double EnergyDaily { get; set; }
        [DataMember]
        public double EnergyTotal { get; set; }
        [DataMember]
        public double String1Voltage { get; set; }
        [DataMember]
        public double String1Current { get; set; }
        [DataMember]
        public double String2Voltage { get; set; }
        [DataMember]
        public double String2Current { get; set; }
        [DataMember]
        public double String3Voltage { get; set; }
        [DataMember]
        public double String3Current { get; set; }
        [DataMember]
        public double Line1Voltage { get; set; }
        [DataMember]
        public double Line1Current { get; set; }
        [DataMember]
        public double Line2Voltage { get; set; }
        [DataMember]
        public double Line2Current { get; set; }
        [DataMember]
        public double Line3Voltage { get; set; }
        [DataMember]
        public double Line3Current { get; set; }

        public PVState()
        {
            ACPower = 0;
            Status = "off";
            EnergyDaily = 0;
            EnergyTotal = 0;
            Line1Voltage = 0; Line1Current = 0;
            Line2Voltage = 0; Line2Current = 0;
            Line3Voltage = 0; Line3Current = 0;
            String1Voltage = 0; String1Current = 0;
            String2Voltage = 0; String2Current = 0;
            String3Voltage = 0; String3Current = 0;
            TimeStamp = DateTime.Now;
        }
        public PVState(string on, double acPower, double dailyEnergy, double totalEnergy, double s1v, double s1c, double s2v, double s2c, double s3v, double s3c, double l1v, double l1c, double l2v, double l2c, double l3v, double l3c)
        {
            ACPower = acPower;
            Status = on;
            EnergyDaily = dailyEnergy;
            EnergyTotal = totalEnergy;
            String1Voltage = s1v;
            String1Current = s1c;
            String2Voltage = s2v;
            String2Current = s2c;
            String3Voltage = s3v;
            String3Current = s3c;
        }

    }

}